//获取本地储存中的token
const getToken = () => localStorage.getItem('token');
//判断本地储存中有没有token
const isLogin = () => !!localStorage.getItem('token')
//删除本地储存中的用户信息
const deleteToken = () => {
  localStorage.removeItem('token')
  localStorage.removeItem('role')
  localStorage.removeItem('userInfo')
}
//把用户信息储存到本地储存中
const pushUser = (params = {}) =>{
  localStorage.setItem('token', params.token)
  localStorage.setItem('userInfo',JSON.stringify(params.userInfo) )
  localStorage.setItem('role',params.role)
} 
export {
  getToken,
  isLogin,
  deleteToken,
  pushUser
}